from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from apps import create_app
from extend import db
from apps.user.models import *
from apps.article.models import *

app = create_app()
manager = Manager(app=app)  # 创建manager管理并绑定app
migrate = Migrate(app=app, db=db)  # 创建migrate管理数据库db和路由app
manager.add_command('db', MigrateCommand)  # 将MigrateCommand命令添加到manger管理中，并取名为db。管理数据库映射




if __name__ == '__main__':
    manager.run()
